var app = getApp();
let api = require("../../utils/api.js")
Page({
  data: {
    list: []
  },

  click: function (e) { 
    // console.log("按了：", e.currentTarget.id)
    var IndexDetailId = e.currentTarget.id;
    // console.log(e.currentTarget,'ppppp')
    // console.log('/pages/indexdetail/indexdetail?IndexDetailId=' + IndexDetailId,'>>>>>>>>')
    wx.navigateTo({
      url: '/pages/indexdetail/indexdetail?IndexDetailId=' + IndexDetailId,
    })
  },

  onLoad(options){
    let token = wx.getStorageSync('token')    //从同步本地缓存中获取token
    // 获取数据
    wx.request({
      url: api.myLove,
      header: {'Authorization':'JWT'+' '+token},
      dataType: "json",
      method: "GET",
      success: (result) => {
       //  console.log(result.data.data,'>>>>>')
        this.setData({
          list:result.data.data
        })
        // console.log(result.data.data,'>>>>>')
      },
    })
  },
  
})
